<?php

namespace App\session;
/**
 * @desc 就是玩玩，不可当真哦
 */
class Apc
{
    static function read($sid)
    {
        return apc_fetch($sid);
    }

    static function write($sid, $data)
    {
        $bool = false;
        $ret = apc_fetch($sid, $bool);
        if ($bool)
        {
            return @apc_store($sid, $data, 30 * 60);
        }
        else
        {
            return apc_add($sid, $data, 30 * 60);
        }
    }

    static function open($path, $name)
    {
        return true;
    }

    static function close()
    {
        return true;
    }

    static function gc()
    {
        return true;
    }

    static function destory($sid)
    {
        return apc_delete($sid);
    }
}